<!--
 * @Author: guo wei
 * @LastEditors: [guo wei]
 * @LastEditTime: 2024-01-11 23:35:17
 * @Description: 
-->
<template>
  <div class="card-wrap">
    <el-tabs type="card">
      <el-tab-pane
        v-for="item in tabData"
        :key="item.buildingTypeCode"
        :label="item.buildingTypeName"
      >
        <Residence :buildingTypeInfoId="item.buildingTypeInfoId"></Residence>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>
<script setup>
import { ref, reactive } from "vue";
import { buildingTypeInfos } from "@/api/building-type";

import Residence from "./residence/index";
const tabData = ref([]);
const getTabData = async () => {
  try {
    const params = {
      count: true,
      pageId: 1,
      pageSize: 20,
      parentId: -1,
    };
    const res = await buildingTypeInfos(params);
    if (res.code == 200) {
      tabData.value = res.result.list || [];
    }
  } catch (error) {}
};
getTabData();
</script>
<style lang="scss" scoped>
.card-wrap {
  margin: 20px;
}
</style>
